<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

//Seyret Component v.0.2//
/**
* Content code
* @package SEYRET
* @Copyright (C) 2007 Mustafa DINDAR
* @ All rights reserved
* @ seyret Component is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version 0.2
**/		

require($mosConfig_absolute_path."/administrator/components/com_seyret/seyret_config.php");  
  
?>

<link href="<?php echo $mosConfig_live_site;?>/components/com_seyret/themes/<?php echo $theme;?>/style/seyret_style.css" rel="stylesheet" type="text/css" />
<?php  


class HTML_seyret {
//Function:htmlseyretfrontpg->start ***************************
function htmlseyretfrontpg() {
global $database, $Itemid, $mosConfig_live_site, $my, $mosConfig_lang, $mosConfig_absolute_path;
require($mosConfig_absolute_path.'/administrator/components/com_seyret/seyret_config.php');	
?>
<script type="text/javascript" src="<?php echo($mosConfig_live_site);?>/components/com_seyret/seyret.js"></script>
<div style="position:relative;"><div id="blockit" style="position:absolute; left:0px; top:0px; width:100%; height:700px; visibility:hidden;"></div></div>
<?php
	
	//read main template
	$templatefile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/frontpage.php";
	$template= jalemseyret_read_file($templatefile)."<div id=\"hiddenvalues\" style=\"display:none;\"></div>";
	
	//read videomainarea
	$videomainareafile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/videomainarea.php";
	$videomainarea= jalemseyret_read_file($videomainareafile);
	
	//read videodirectories
	$videodirectiestemplatefile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/grouplist.php";
	$videodirectoriestemplate= jalemseyret_read_file($videodirectiestemplatefile);


	$ajaxgif="<img id=\"ajxgif\" style=\"visibility:hidden; vertical-align:middle;\" align=\"center\" src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/wait.gif\" border=\"0\" >";

	$toolbar=rendertoolbar();
	
	$pendingvideobutton="<span class=\"pendingvideobutton\"><a href=\"index.php?option=com_seyret&task=editvideos\">"._PENDINGVID."</a></span>";
	

	$videolist=videolist("0",$cid);
	$videolist="<div id=\"videolistdiv\">".$videolist."</div>";

	$videotitle="<div id=\"videotitlearea\" class=\"videotitleinmainarea\"></div>";
	$videodetailsarea="<div id=\"videodetailsarea\" class=\"videodetailsinmainarea\"></div>";
	$videooperationsarea="<div id=\"videooperationsarea\" style=\"width:90%; position:relative;\" class=\"videooperationsinmainarea\"></div>";
	$videoembedarea="<div id=\"showvideo\" class=\"videoarea\"><img src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/video.png\" width=\"".$videowidth."px\" border=\"0\"></div>";
	$votearea="<div id=\"votearea\" class=\"votearea\"></div>";
	$embedcode="<div id=\"embedcode\"></div>";
	$videodirectlink="<div id=\"videodirectlink\"></div>";
	$comments="<div id=\"comments\"></div>";
	
	$cid = mosGetParam($_REQUEST,'catid',null);
	$categorylist=HTML_seyret::htmlvideocatlist($cid);
	
	//write template values

	$template = str_replace( "{videodirectoriesheader}", $videodirectoriestemplate, $template );
	$template = str_replace( "{toolbar}", $toolbar, $template );
	$template = str_replace( "{adminshowpendingvideobutton}", $pendingvideobutton, $template );
	$template = str_replace( "{ajaxgif}", $ajaxgif, $template );
	$template = str_replace( "{videomainarea}", $videomainarea, $template );
	$template = str_replace( "{videotitle}", $videotitle, $template );
	$template = str_replace( "{showvideodetailsarea}", $videodetailsarea, $template );
	$template = str_replace( "{videooperations}", $videooperationsarea, $template );
	$template = str_replace( "{videolistarea}", $videolist."", $template );
	$template = str_replace( "{embedvideoarea}", $videoembedarea, $template );
	$template = str_replace( "{videoembedcode}", $embedcode, $template );
	$template = str_replace( "{videourl}", $videodirectlink, $template );
	$template = str_replace( "{videogrouptitle}", _VIDEOGROUPTITLE, $template );	
	$template = str_replace( "{categorylist}", $categorylist, $template );	
	$template = str_replace( "{comments}", $comments, $template );	
	$template = str_replace( "{videovotearea}", $votearea, $template );	
	echo $template;
}//end of frontpage




function htmlvideocatlist($cid){
global $database, $mosConfig_absolute_path,$mosConfig_live_site;
require($mosConfig_absolute_path."/administrator/components/com_seyret/seyret_config.php");  



if ($cid!=''){
	$database->setQuery("SELECT * FROM #__seyret_categories WHERE id='$cid'");
	$cat = $database->loadObjectList();
	foreach ($cat as $cat) {
	$catid = $cat->catid;
	$vidcatname = $cat->categoryname;
	}//get cat id and catname here

}

$database->setQuery( "SELECT * FROM #__seyret_categories WHERE parentcat='$catid' ORDER BY categoryname ASC" );
$rows = $database->loadObjectList();
if ($database->getErrorNum()) {
	echo $database->stderr();
	return false;
	} //get sub categories
$linkedpath=ShowSeyretCategoryLinkedPath($catid);
$videocatd="<span class=\"linkedpath\">".$linkedpath."</span>"."<table width=\"100%\"><tr>";

		$column=1;
		for($i=0; $i < count( $rows ); $i++) 
		{
			$row = $rows[$i];	
			$videocatd.="<td width=\"50%\">";
			$catname="<span style=\"cursor:pointer;\" onclick=\"sndReqDirectory(".$row->id.")\">".$row->categoryname."</span>";

				$database->setQuery( "SELECT * FROM #__seyret_categories WHERE parentcat='$row->catid'" );
				$rowsub = $database->loadObjectList();
				$rowsubs="";
				$subcats="";
				if ($database->getErrorNum()) {
					echo $database->stderr();
					return false;
					}
				for($m=0; $m < count( $rowsub ); $m++) {
					$rowsubs = $rowsub[$m];
					$subcats.="<span style=\"cursor:pointer;\" onclick=\"sndReqDirectory(".$rowsubs->id.")\">".$rowsubs->categoryname."</span>, ";
					
					}

		$database->setQuery("SELECT count(*) FROM #__seyret_items WHERE published='1' AND catid='$row->catid'");
		$total = $database->loadResult(); 
		if ($total<>0){
			$database->setQuery("SELECT * FROM #__seyret_items WHERE  published='1' AND catid='$row->catid'");
			$vid = $database->loadObjectList();
			foreach ($vid as $vid) {
			$imglink = $vid->picturelink;
			if ($imglink==""){
			$imglink=$mosConfig_live_site."/components/com_seyret/localplayer/nothumbnail.png";
		}
			}
		} else {
			  $imglink=$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/directory.gif";		
		}
		$dirimage="<img src=".$imglink ." width=\"80px;\"\ height=\"60px\">";

		
		$subtemplatefile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/directory.php";
		$subtemplate= jalemseyret_read_file($subtemplatefile);
		$subtemplate = str_replace( "{dirimage}", $dirimage, $subtemplate );			
		$subtemplate = str_replace( "{dirname}", $catname, $subtemplate );			
		$subtemplate = str_replace( "{dirsubcategories}", $subcats, $subtemplate );	
		$videocatd.=$subtemplate;
		$videocatd.="</td>";
		if ($column==1) {
			$column=2;
			}
			else
			{
			$videocatd.="</tr><tr>";
			$column=1;
			}
		} // end of for next
	
	$videocatd.="</table>";
	
	return $videocatd;
	
}

function htmladdlinkfront() {
global $database, $mosConfig_live_site, $mosConfig_absolute_path;
require($mosConfig_absolute_path."/administrator/components/com_seyret/seyret_config.php");
						$database->setQuery( "SELECT id, categoryname"
						."\nFROM #__seyret_categories");
				
						$mycats=array();						
						$mycats[] = mosHTML::makeOption( '', "Top" );
						$cats = $database->loadObjectList();
						foreach ($cats as $cats) 
						{
						$myid = $cats->id;
						$mycname = $cats->categoryname;


						$mycats[] = mosHTML::makeOption( $myid, $mycname );
						}
						$catslist = mosHTML::selectList($mycats,"catid",'class="inputbox" size="1"'.$javascript,"value","text");
							
						$ajaxgif="<img id=\"ajxgif\" style=\"visibility:hidden; vertical-align:middle;\" align=\"center\" src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/wait.gif\" border=\"0\" >";

						$ajx=rendertoolbar();
						$ajx = str_replace( "{ajaxgif}", $ajaxgif, $ajx );
						echo $ajx;
?>
<script type="text/javascript" src="<?php echo($mosConfig_live_site);?>/components/com_seyret/seyret.js"></script>

	
<form action="index2.php" method="post" name="adminForm">

	<table width="100%">
		<tr>
			<td colspan="3"><?php echo _ADDVIDEOINFO;?></td>
		</tr>
		
		<tr>
			<td><?php echo _INPUTLINK;?></td><td><input type="text" id="videolink" name="videolink" size="50" class="text_area"/></td>
			<td><button type="button" onclick="applyvideolink()"><?php echo _APPLY;?></td>
		</tr>	
	</table>
	
	<div id="videodetailsinput"></div>
	 
	 
<input type="hidden" name="option" value="com_seyret" />
<input type="hidden" name="task" value="savevideoitem" />


</form>
<?php

}


function htmlvideodirectlink($id) {
global $database, $Itemid, $mosConfig_live_site, $my, $mosConfig_lang, $mosConfig_absolute_path;
require($mosConfig_absolute_path.'/administrator/components/com_seyret/seyret_config.php');	
require($mosConfig_absolute_path.'/components/com_seyret/seyret_permissions.php');	
?>
<script type="text/javascript" src="<?php echo($mosConfig_live_site);?>/components/com_seyret/seyret.js"></script>
<div style="position:relative;"><div id="blockit" style="position:absolute; left:0px; top:0px; width:100%; height:700px; visibility:hidden;"></div></div>
<?php
	

	
	$database->setQuery("SELECT * FROM #__seyret_items WHERE id='$id'");
	$vids = $database->loadObjectList();
	foreach ($vids as $vids) {
	$catid = $vids->catid;
	$thevideotitle=$vids->title;
	$theviddetails=$vids->itemcomment;
	$vtype=$vids->videoservertype;
	$vcode=$vids->videoservercode;
	$vhit=$vids->hit;
	}

	if ($vtype==""){
		$query = "DELETE FROM #__seyret_items WHERE id='$id'";
		$database->setQuery( $query );
		if (!$database->query()) {
			echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>\n";
		}
		mosRedirect( "index.php?option=com_seyret");
	} else {
	
	//strripos doesn't work in php 4 :(
	$catid = str_replace( "**", "a", $catid );
	$twostarrightposition=strrchr($catid,"a");
	$newcatid=substr($catid, $twostarrightposition, strlen($catid));
	$catid = str_replace( "a", "**", $catid );
	
	//increase hit------------
	$newhit=$vhit+1;

	$database->setQuery("UPDATE #__seyret_items SET hit='$newhit' WHERE id='$id' ");
	if (!$database->query()){
		echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>n";
		exit();
	}
	//-----------------------------
	
	
	$newcatid = str_replace( "*", "", $newcatid );	
	$cid = str_replace( "#", "", $newcatid );	
	
	//read main template
	$templatefile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/frontpage.php";
	$template= jalemseyret_read_file($templatefile)."<div id=\"hiddenvalues\" style=\"display:none;\"><div id=\"hiddenthevideoid\">".$id."</div></div>";
	
	//read videomainarea
	$videomainareafile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/videomainarea.php";
	$videomainarea= jalemseyret_read_file($videomainareafile);
	
	//read videodirectories
	$videodirectiestemplatefile=$mosConfig_absolute_path."/components/com_seyret/themes/".$theme."/templates/grouplist.php";
	$videodirectoriestemplate= jalemseyret_read_file($videodirectiestemplatefile);


	$ajaxgif="<img id=\"ajxgif\" style=\"visibility:hidden; vertical-align:middle;\" align=\"center\" src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/wait.gif\" border=\"0\" >";

	if ($my->id){
	$addvideobutton="<span style=\"float:left;\" class=\"addvideobutton\"><a href=\"index.php?option=com_seyret&task=addlinkfront\">"._ADDVIDEO."</a></span>";
	
		if ($userscanuploadvideo=="1"){
		$useruploadvideo="<span style=\"float:left;\" class=\"addvideobutton\"><a href=\"index.php?option=com_seyret&task=uploadvideo\">"._UPLOADVIDEO."</a></span>";
		}
		else
		{
		$useruploadvideo="";
		}
	}
	
	

	$videolist=videolist("0",$cid);
	$videolist="<div id=\"videolistdiv\">".$videolist."</div>";

	$includepluginfile=$mosConfig_absolute_path."/components/com_seyret/plugins/videoserver/".$vtype.".php";
    require_once($includepluginfile);
	
	$vcode=jalemurlencode($vcode);	
	$fvtype=str_replace(".","",$vtype);
	$popupvtype=jalemurlencode($vtype);
	$functionname=$fvtype."embed"; 
	$embed=$functionname($vcode);
	
	
//===================================================================================================	
	//*******************************
	if ($showembedcode=="yes"){
	$embed=str_replace("\"","'",$embed);
	$database->setQuery("SELECT * FROM #__seyret_check");
	$snippet = $database->loadObjectList();
		foreach ($snippet as $snippet) {
		$ssnip=$snippet->seyretsnippet;	
		$ssnip=str_replace("\"","'",$ssnip);
		}
	$embedcode="<table width=\"100%\"><tr><td>"._VIDEOEMBEDCODE.":</td><td width=\"1%\"><input type=\"text\" id=\"embedlink\" name=\"embedlink\" class=\"videoembedcode\" onClick=\"showshareembed()\" readonly=\"true\" value=\"".$embed.$ssnip."\"/></td></tr></table>";
	}
	//*******************************

	//*******************************
	if ($showvideodirectlink=="yes"){	
	$viddirectlink=$mosConfig_live_site."/index.php?option=com_seyret&task=videodirectlink&id=".$id;
	$videodirectlink="<table width=\"100%\"><tr><td>"._VIDEOURL.":</td><td width=\"1%\"><input type=\"text\" id=\"videolink\" name=\"videolink\" class=\"videodirectlink\" onClick=\"showdirectlink()\" readonly=\"true\" value=\"".$viddirectlink."\"/></div></td></tr></table>";
	}
	//*******************************
	
	
	//*******************************
	if ($showdownloadbutton=="yes"){
		$vstrcode = jalemurlencode($vcode );
		$downloadrequest=$mosConfig_live_site."/index2.php?option=com_seyret&no_html=1&task=flvdownloadreq&vcode=".$vstrcode."&servertype=".$vtype;
		$vdownloadlink="<td><img style=\"cursor:pointer;\" onclick=openinpopup('$downloadrequest','400','20') src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/".$mosConfig_lang."/download.png\" border=\"0\"></td>";
	}
	//*******************************
	
	

	//*******************************
	if ($showeditbutton=="yes"){
		$editthisvideo="<td><a href=\"".$mosConfig_live_site."/index.php?option=com_seyret&task=editvideos&id=".$id."\"><img  src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/".$mosConfig_lang."/edit.png\" border=\"none\"/></a></td>";
	}	
	//*******************************
	
	//*******************************	
	if ($showreportbutton=="yes"){	
		$reportthisvideo="<td><a href=\"".$mosConfig_live_site."/index.php?option=com_seyret&task=reportvideo&id=".$id."\"><img  src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/".$mosConfig_lang."/report.png\" border=\"none\"/></a></td>";
	}
	//*******************************
	
	
	//*******************************	
	if ($showdeletevideobutton=="yes"){	
	$deletethisvideo="<td><a href=\"javascript:if (confirm('"._DELETEVIDEOCONFIRMMESSAGE."')){ window.location.href='index.php?option=com_seyret&task=deletevideo&id=".$id."'}\"><img src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/".$mosConfig_lang."/delete.png\" border=\"0\"></a></td>";
	}
	//*******************************

	
	//*******************************
	if ($showpopupbutton=="yes"){	
	$popupurl=$mosConfig_live_site."/index2.php?option=com_seyret&no_html=1&task=embedpopup&vcode=".$vcode."&servertype=".$popupvtype."&vidwindow=popup";
	$popupwidth=$popupvideowidth+50;
	$popupheight=$popupvideoheight+30;
	$openinnewwindow="<td><img style=\"cursor:pointer;\" onclick=openinpopup('$popupurl','$popupwidth','$popupheight') src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/".$mosConfig_lang."/openinpopup.png\" border=\"0\"></td>";
	}
	//*******************************
	
	$voperations="<table><tr>";
	$voperations.=$deletethisvideo.$editthisvideo.$openinnewwindow.$vdownloadlink.$reportthisvideo;
	$voperations.="</tr></table>";

	if ($usevideovotesystem=="yes"){	
		if ($videovoteactive=="yes"){
			$votearea="<table><tr><td>"._VOTEIT.":</td><td>".getvotestarsenabled($id)."</td></tr></table>";
		} else {
			if ($logintovotetext=="yes")
			{
			$votearea="<table><tr><td>"._LOGINTOVOTE.":</td><td>".getvotestarsdisabled($id)."</td></tr></table>";
			} else {
			$votearea="<table><tr><td>"._RATING.":</td><td>".getvotestarsdisabled($id)."</td></tr></table>";
			}
			
		}
	}
//===================================================================================================


	
	$ajaxgif="<img id=\"ajxgif\" style=\"visibility:hidden; vertical-align:middle;\" align=\"center\" src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/wait.gif\" border=\"0\" >";
	
	$videotitle="<div id=\"videotitlearea\" class=\"videotitleinmainarea\">".$thevideotitle."</div>";
	$videodetailsarea="<div id=\"videodetailsarea\" class=\"videodetailsinmainarea\">".$theviddetails."</div>";
	$videooperationsarea="<div id=\"videooperationsarea\" style=\"width:90%; position:relative;\"  class=\"videooperationsinmainarea\">".$voperations."</div>";
	$videoembedarea="<div id=\"showvideo\" class=\"videoarea\">".$embed."</div>";
	$votearea="<div id=\"votearea\" class=\"votearea\">".$votearea."</div>";
	$embedcode="<div id=\"embedcode\">".$embedcode."</div>";
	$videodirectlink="<div id=\"videodirectlink\">".$videodirectlink."</div>";

	$categorylist=HTML_seyret::htmlvideocatlist($cid);
	
	$comments="<div id=\"comments\">".getseyretcomments($id)."</div>";
	
	$toolbar=rendertoolbar();
	//write template values

	$template = str_replace( "{videodirectoriesheader}", $videodirectoriestemplate, $template );
	$template = str_replace( "{addvideobutton}", $addvideobutton, $template );
	$template = str_replace( "{uploadvideobutton}", $useruploadvideo, $template );
	$template = str_replace( "{adminshowpendingvideobutton}", $pendingvideobutton, $template );
	$template = str_replace( "{ajaxgif}", $ajaxgif, $template );
	$template = str_replace( "{videomainarea}", $videomainarea, $template );
	$template = str_replace( "{videotitle}", $videotitle, $template );
	$template = str_replace( "{showvideodetailsarea}", $videodetailsarea, $template );
	$template = str_replace( "{videooperations}", $videooperationsarea, $template );
	$template = str_replace( "{videolistarea}", $videolist."", $template );
	$template = str_replace( "{embedvideoarea}", $videoembedarea, $template );
	$template = str_replace( "{videoembedcode}", $embedcode, $template );
	$template = str_replace( "{videourl}", $videodirectlink, $template );
	$template = str_replace( "{videogrouptitle}", _VIDEOGROUPTITLE, $template );	
	$template = str_replace( "{categorylist}", $categorylist, $template );	
	$template = str_replace( "{videovotearea}", $votearea, $template );	
	$template = str_replace( "{comments}", $comments, $template );	
	$template = str_replace( "{toolbar}", $toolbar, $template );
	$template = str_replace( "{ajaxgif}", $ajaxgif, $template );
	
	echo $template;
	}
}//end of htmlvideodirectlink



function htmleditvideos($id){
global $database, $mosConfig_absolute_path, $mosConfig_live_site;
require($mosConfig_absolute_path.'/administrator/components/com_seyret/seyret_config.php');	



	$database->setQuery("SELECT * FROM #__seyret_items WHERE id='$id'");
	$vids = $database->loadObjectList();
	foreach ($vids as $vids) {
	$videocatid = $vids->catid;
	$thevideotitle=$vids->title;
	$theviddetails=$vids->itemcomment;
	$vtype=$vids->videoservertype;
	$vcode=$vids->videoservercode;
	$vthumb=$vids->picturelink;
	$owner=$vids->addedby;
	$vdate=$vids->addeddate;
	$vpublish=$vids->published;
	}

	if ($vtype==""){
		$query = "DELETE FROM #__seyret_items WHERE id='$id'";
		$database->setQuery( $query );
		if (!$database->query()) {
			echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>\n";
		}
		mosRedirect( "index.php?option=com_seyret");
	}
	
	$database->setQuery( "SELECT * FROM #__seyret_categories ORDER BY catid ASC");

	$videocat = $database->loadObjectList();
	$videocats = array();
	$videocats[] = mosHTML::makeOption( '',_TOPLEVEL );
	foreach ($videocat as $videocat) 
	{
		$catid = $videocat->catid;
		$catname = $videocat->categoryname;
		
		$catids="";
		$fordatacatname='';
		$fordatacatnamelast='';
		
		$catidlength=strlen($catid);
		$newcatid=substr($catid,1,$catidlength-3);
		$catid_array=explode('**',$newcatid);


		while ($catidelement=each($catid_array)){
			$fordatacatname=$fordatacatname.'**'.$catidelement['value'];
			$fordatacatnamelast=substr($fordatacatname,1,strlen($fordatacatname)).'*#';
			
				$database->setQuery("SELECT n.* FROM #__seyret_categories AS n WHERE catid='$fordatacatnamelast'");
				$cat = $database->loadObjectList();
				foreach ($cat as $cat) {
				$cat_cat = $cat->categoryname;
				}
			$catids=$catids.$cat_cat.' - ';
		}
		$catidlast=substr($catids,0, strlen($catids)-3);
		$videocats[] = mosHTML::makeOption( $catid, $catidlast );
	}
	$categorylist = mosHTML::selectList($videocats,"catid",'class="inputbox" size="1"',"value","text",$videocatid );

	
	$includepluginfile=$mosConfig_absolute_path."/components/com_seyret/plugins/videoserver/".$vtype.".php";
    require_once($includepluginfile);
	
	$fvtype=str_replace(".","",$vtype);
	$functionname=$fvtype."embed"; 
	$embed=$functionname($vcode);

?>
<form action="index2.php" method="post" name="adminForm">
<table width="100%" style="border:1px solid #999999;">
	<tr>
		<td align="center"><?php echo $embed;?>
		</td>
	</tr>
</table>
<br>
<table width="100%" style="border:1px solid #999999;">
	<tr>
	<td width="30%"><?php echo _VIDEOTITLE;?></td><td  colspan="2"><input type="text" id="title" name="title" size="40" class="text_area"value="<?php echo $thevideotitle;?>"/></td>
	</tr>
	
	<tr>
	<td><?php echo _DETAILS;?></td><td  colspan="2"><input type="text" id="itemcomment" name="itemcomment" size="40" class="text_area"value="<?php echo $theviddetails;?>"/></td>
	</tr>

	<tr>
	<td><?php echo _VIDEOCAT_PARENT;?></td><td colspan="2"><?php echo $categorylist;?></td>
	</tr>	

	<tr>
	<td width="30%"><?php echo _VTHUMB;?></td><td colspan="2"><input type="text" id="picturelink" name="picturelink" size="40" class="text_area"value="<?php echo $vthumb;?>"/></td>
	</tr>

	<tr>
	<td width="30%"><?php echo _VSERVERTYPE;?></td><td><input type="text" id="videoservertype" name="videoservertype" size="20" class="text_area"value="<?php echo $vtype;?>"/></td><td rowspan="5"><img width="90px" src="<?php echo $vthumb;?>"/></td>
	</tr>

	<tr>
	<td width="30%"><?php echo _VSERVERCODE;?></td><td><input type="text" id="videoservercode" name="videoservercode" size="20" class="text_area"value="<?php echo $vcode;?>"/></td>
	</tr>

	<tr>
	<td width="30%"><?php echo _ADDEDBY;?></td><td><input type="text" id="addedby" name="addedby" size="20" class="text_area"value="<?php echo $owner;?>"/></td>
	</tr>

	<tr>
	<td width="30%"><?php echo _ADDEDDATE;?></td><td><input type="text" id="addeddate" name="addeddate" size="20" class="text_area"value="<?php echo $vdate;?>"/></td>
	</tr>

	<tr>
	<td width="30%"><?php echo _IFPUBLISHED;?></td><td><input type="radio" name="published" value="0" checked="checked" /><?php echo _NO;?><input type="radio" name="published" value="1" <?php 
							if ($vpublish == "1") {
							echo "checked=\"checked\" ";
							} ?> /> <?php echo _YES;?> </td>
	</tr>

	<tr>
	<td colspan="2" align="center"><button type="submit"><?php echo _SAVE;?></td><td><?php echo "<a href=\"javascript:if (confirm('"._DELETEVIDEOCONFIRMMESSAGE."')){ window.location.href='index.php?option=com_seyret&task=deletevideo&id=".$id."'}\"><img src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/delete.png\" border=\"0\">"._DELETETHISVIDEO."</a>";?></td>
	</tr>	

	
	
</table>
<input type="hidden" name="tasksender" value="editvideo">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="option" value="com_seyret" />
<input type="hidden" name="task" value="savevideoitem" />


</form>	
<?php	
}

function htmluploadvideo(){
global $database, $mosConfig_absolute_path, $mosConfig_live_site;
require($mosConfig_absolute_path.'/administrator/components/com_seyret/seyret_config.php');	

$videomaxuploadsize=$videomaxuploadsize*1000000;

?>
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm">
<table width="100%" style="border:1px solid #999999; text-align:left;">
	<tr>
	<td width="100%"><?php echo _UPLOADVIDEOINFORM;?></td>
	<td><?php echo "<img align=\"center\" src=\"".$mosConfig_live_site."/components/com_seyret/themes/".$theme."/images/uploadvideo.png\" border=\"0\" >";?></td>
	</tr>
	<tr>
	<td colspan="2">
		<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $videomaxuploadsize;?>">
		<input name="useruploadedvideo" type="file"><p>
		<input type="submit" value="<?php echo _UPLOADANDGOTONEXT;?>">
	</td>
	</tr>
</table>
<input type="hidden" name="option" value="com_seyret" />
<input type="hidden" name="task" value="processvideoupload" />
</form>
<?
}

}// end of html class
?>